<template>
	<view class="warp">
		<view style="padding: 0 30rpx;">
			<view class="item">
				<image class="touxiang" :src="data.user_image" mode="aspectFill"></image>
				<view class="name">{{data.user_nickname}}</view>
				<view class="type">{{data.createtime}}</view>
				<view class="mt20">{{data.content}}</view>
				<image class="mt20" src="http://xiaowen.cool:86/2.png" mode="widthFix"></image>
			</view>
			<view class="item mt20">
				<view class="s-title mt20">全部评论</view>
				<view class="pl-item mt20" v-for="(item,index) in data.comment">
					<image class="touxiang" :src="item.user_image" mode="aspectFill"></image>
					<view class="name">{{item.user_nickname}}</view>
					<view class="time">{{item.createtime}}</view>
				<view class="mt20">{{item.detail}}</view>

					<view class="line mt30"></view>
				</view>
			</view>
			<view class="item footer">
				<view class="input">
					<input placeholder="我来评论..." />
				</view>
				<view class="items iconfont" style="margin-left: 50rpx">&#xe605;&nbsp;&nbsp;{{data.share_num}}</view>
				<view class="items iconfont">&#xe604;&nbsp;&nbsp;{{data.like_num}}</view>
				<!-- <view class="items iconfont">&#xe61a;&nbsp;&nbsp;{{data.comment_num}}</view> -->
			</view>
		</view>

	</view>
</template>

<script>
	import {interactiveDetails} from "../../api/api.js"
	export default {
		data() {
			return {
				id:null,
				uid:null,
				"data": {
					"id": 1,
					"type": "心理学",
					"user_image": "http://xiaowen.cool:86/2.png",
					"user_nickname": "用户1",
					"title": "测试发帖",
					"content": "测试发帖",
					"comment_num": 1,
					"like_num": 2,
					"share_num": 3,
					"createtime": "1970-01-01 08:00:00",
					"like_status": 0,
					"comment": [{
						"user_id": 1,
						"user_nickname": "zhang",
						"detail": "测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论1贴",
						"createtime": "1970-01-01 08:00:00",
						"user_image": "http://xiaowen.cool:86/2.png"
					},{
						"user_id": 1,
						"user_nickname": "zhang",
						"detail": "测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论测试评论1贴",
						"createtime": "1970-01-01 08:00:00",
						"user_image": "http://xiaowen.cool:86/2.png"
					}]
				}
			}
			},
			onLoad(options){
				console.log(options)
				this.id = options.id
				this.uid = options.uid
				this.datainit()
			},
			methods:{
				datainit(){
					let data = {
						id:this.id,
						user_id:this.uid
					}
					// 请求首页数据
					let sign = this.$util(data)
					interactiveDetails(sign).then(res => {
					this.data = res.data
					})
				},
			}
		
	}
</script>

<style scoped lang="less">
	.warp {
		padding: 50 0rpx;
		background-color: rgb(229, 229, 229);
	}

	.item {
		width: 100%;
		// height: 50vh;
		padding: 30rpx 50rpx;
		background-color: #FFFFFF;
		padding: 30rpx;
		border-radius: 10rpx;
		margin-left: 50%;
		transform: translateX(-50%);
		position: relative;

		.name {
			position: absolute;
			top: 20rpx;
			left: 130rpx;
		}

		.type {
			position: absolute;
			top: 60rpx;
			color: #999999;
			left: 130rpx;
		}

		.content {
			position: absolute;
			top: 100rpx;
			width: 84%;
			height: 250rpx;
			padding: 30rpx 0;
			// background-color: blue;
			left: 30rpx;
		}

		.imagelist {
			display: flex;
			justify-content: flex-start;
			align-items: center;
			height: 160rpx;
			position: absolute;
			top: 200rpx;
		}

	}

	.footer {
		display: flex;
		justify-content: flex-end;
		position: fixed;
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		background-color: #FFFFFF;
		bottom: 0rpx;

		.items {
			width: 100rpx;
			color: #999999;
		}

		.input {
			background-color: rgb(229, 229, 229);
			border-radius: 50rpx;
			width: 60%;
			position: relative;

			input {
				position: absolute;
				bottom: 15rpx;
				left: 15rpx;
			}
		}
	}

	.pl-item {
		position: relative;

		.name {
			position: absolute;
			top: 10rpx;
			left: 130rpx;
		}

		.type {
			position: absolute;
			top: 60rpx;
			color: #999999;
			left: 130rpx;
		}

		.content {
			position: absolute;
			top: 100rpx;
			width: 84%;
			height: 250rpx;
			padding: 30rpx 0;
			// background-color: blue;
			left: 30rpx;
		}
		.time{
			position: absolute;
			top: 10rpx;
			color: #999999;
			right: 80rpx;
		}
	
		.imagelist {
			display: flex;
			justify-content: flex-start;
			align-items: center;
			height: 160rpx;
			position: absolute;
			top: 200rpx;
		}
	}
</style>
